package com.ddwanglife.bilibili;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class CMDDemo {
    public static void main(String[] args) {
        String cmd = "ffmpeg -i C:\\Users\\wangdongdong\\Desktop\\83622425\\20\\80\\video.m4s -i C:\\Users\\wangdongdong\\Desktop\\83622425\\20\\80\\audio.m4s -c copy C:\\Users\\wangdongdong\\Desktop\\尚硅谷2020最新版宋红康JVM教程\\20-KVM-CDC-CLDC的介绍.mp4\n";
        try {
            Process process = Runtime.getRuntime().exec(cmd);
            InputStreamReader isr = new InputStreamReader(process.getInputStream(),"GBK");
            BufferedReader br = new BufferedReader(isr);
            String content = br.readLine();
            while (content != null) {
                System.out.println(content);
                content = br.readLine();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
